<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	<TITLE>iBOS/e WebShell</TITLE>
	<CFOUTPUT>
	<LINK REL="StyleSheet" HREF="#client.wstheme_path##client.empcolor#.css" TYPE="text/css">
	</cfoutput>
</head>
<body>
	<!--- get the orgtree field --->
	<CFQUERY NAME="qryTreeField" DATASOURCE=#client.global_dsn#>
		SELECT COLUMNNAME
		FROM GRGBOSETABLEFIELDS
		WHERE TABLENAME = '#url.TABLE#' AND
			  (ISORGCHART = 'Y' OR ISORGCHART = 'y')
	</CFQUERY>

	<CFIF url.VALUE IS "">
		<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE="Error in Lookup Setup">
		<CFOUTPUT>
		<b>#url.COLUMNDESC# is currently empty.<br></b>
		</CFOUTPUT>
		<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TOP="False">
	<CFELSEIF qryTreeField.RecordCount>
		<CFMODULE TEMPLATE="#client.common_path#cfm_leveldsn.cfm" DBLEVEL="#url.LEVELID#">
		<CFSET lk_dsn = DSN>
	
		<CFQUERY NAME="GetLkDesc" DATASOURCE="#lk_dsn#">
			SELECT #qryTreeField.COLUMNNAME#, #url.DESC#
			FROM #url.TABLE#
			WHERE (#url.LKUPKEYCODE# = '#url.VALUE#')
		</CFQUERY>

		<CFSET sTitle=Evaluate("GetLkDesc." & #url.DESC#)>
		<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE="#sTitle#">	
		<br>
		<CFSET sMemoTree=Evaluate("GetLkDesc." & #qryTreeField.COLUMNNAME#)>
		<CFMODULE TEMPLATE="#client.common_path#cfm_memo2table.cfm" ORGTREE="#sMemoTree#">
		<CFMODULE TEMPLATE="#client.common_path#cfm_table2chart.cfm" TREEKEYID="#TREEKEYID#" WIDTH="100px">
		<br>
		<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TOP="False">
	<CFELSE>
		<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TITLE="Error in Lookup Setup">
		<b>Lookup was not properly setup.<br>
		Please contact your iBOS/e Administrator.</b>
		<CFMODULE TEMPLATE="#client.common_path#cfm_wswindow.cfm" TOP="False">
	</CFIF>
</body>
</html>
